<template>
    <div id="header">
      <el-divider></el-divider>
      <h2>这是一个头部组件,下面的msg是传入的内容</h2>
	  <h2>msg:{{msg}}</h2>

      <el-divider></el-divider>
      <h2>下面是传入的list</h2>
      <ul>
        <li v-for="data in list">
          {{data.title}}
        </li>
      </ul>

      <div>
        <h2>测试父组件传入方法</h2>
        <p>
          <button @click="getData()">parent method</button>
        </p>
      </div>

      <div>
        <h2>测试父组件传入this</h2>
        <p>
          <button @click="getPatentThis()">parent this</button>
        </p>
      </div>
    </div>
</template>

<script>
  export default{
    data(){
      return{

      }
    },
    methods: {
      getPatentThis() {
        alert("this.mainThis.title :"+this.mainThis.title)
      }
    },

    props:['list','msg','getData','mainThis']
  }
</script>
